<!DOCTYPE html>
<html lang="zh-Hans">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.2.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/vhuichen.ico">
  <link rel="icon" type="image/png" sizes="32x32" href="/vhuichen.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/vhuichen.ico">
  <link rel="mask-icon" href="/vhuichen.ico" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha256-AbA177XfpSnFEvgpYu1jMygiLabzPCJCRIBtR5jGc0k=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"vhuichen.github.io","root":"/","images":"/images","scheme":"Pisces","darkmode":false,"version":"8.13.0","exturl":false,"sidebar":{"position":"left","display":"display","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"}}</script><script src="/js/config.js"></script>

    <meta property="og:type" content="website">
<meta property="og:title" content="vhuichen">
<meta property="og:url" content="https://vhuichen.github.io/page/10/index.html">
<meta property="og:site_name" content="vhuichen">
<meta property="og:locale">
<meta property="article:author" content="vhuichen">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://vhuichen.github.io/page/10/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":true,"isPost":false,"lang":"zh-Hans","comments":"","permalink":"","path":"page/10/index.html","title":""}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>vhuichen</title>
  






  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">vhuichen</h1>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">记录、分享</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section">Home</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section">Archives</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section">About</a></li>
  </ul>
</nav>




</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-overview-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="vhuichen"
      src="/images/vhuichen.jpg">
  <p class="site-author-name" itemprop="name">vhuichen</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">78</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">11</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">86</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="Back to top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner index posts-expand">

    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://vhuichen.github.io/2016/10/2016/10/iOS%E5%9F%BA%E7%A1%80%E4%B9%8BCocoapods/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/vhuichen.jpg">
      <meta itemprop="name" content="vhuichen">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="vhuichen">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | vhuichen">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2016/10/2016/10/iOS%E5%9F%BA%E7%A1%80%E4%B9%8BCocoapods/" class="post-title-link" itemprop="url">iOS基础之Cocoapods</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2016-10-28 21:14:26" itemprop="dateCreated datePublished" datetime="2016-10-28T21:14:26+08:00">2016-10-28</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">Edited on</span>
      <time title="Modified: 2018-07-01 16:04:41" itemprop="dateModified" datetime="2018-07-01T16:04:41+08:00">2018-07-01</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/iOS%E5%9F%BA%E7%A1%80/" itemprop="url" rel="index"><span itemprop="name">iOS基础</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="序言"><a href="#序言" class="headerlink" title="序言"></a>序言</h1><p>被<code>CocoaPods</code>虐好几次了！**~~~~(&gt;_&lt;)~~~~**</p>
<h1 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h1><p>其实就那么两条一句</p>
<blockquote>
<p><strong>sudo gem install cocoapods</strong><br><strong>pod setup</strong>   </p>
</blockquote>
<p>但是两次都花了不止一天的时间才安装好 <strong><del>坑</del></strong></p>
<h1 id="Problem"><a href="#Problem" class="headerlink" title="Problem"></a>Problem</h1><h2 id="gem版本比较旧，需要先升级版本"><a href="#gem版本比较旧，需要先升级版本" class="headerlink" title="gem版本比较旧，需要先升级版本"></a>gem版本比较旧，需要先升级版本</h2><p>查看版本</p>
<blockquote>
<p>gem –version</p>
</blockquote>
<p>升级版本</p>
<blockquote>
<p>sudo gem update –system</p>
</blockquote>
<p>到这里这个问题就解决了</p>
<h2 id="Ruby的默认软件源被墙，需要跟换软件源"><a href="#Ruby的默认软件源被墙，需要跟换软件源" class="headerlink" title="Ruby的默认软件源被墙，需要跟换软件源"></a>Ruby的默认软件源被墙，需要跟换软件源</h2><p>网上给出了很多的答案，可以这样做</p>
<blockquote>
<p>gem sources –remove <a target="_blank" rel="noopener" href="https://rubygems.org/">https://rubygems.org/</a><br>gem sources -a <a target="_blank" rel="noopener" href="https://ruby.taobao.org/">https://ruby.taobao.org/</a>   </p>
</blockquote>
<p><strong>就可以了？NO</strong><br><code>https://ruby.taobao.org/</code>这个网站已经不再维护了，如果把软件源更换到淘宝的这个镜像，会无法<code>setup</code>，至少我这里试了好几次都不行。<br>进入这个网站会有相关信息说明，相关的管理工作已经交给<code>https://gems.ruby-china.org/</code>来做了。<br>具体操作是：   </p>
<blockquote>
<p>gem sources –add <a target="_blank" rel="noopener" href="https://gems.ruby-china.org/">https://gems.ruby-china.org/</a><br>gem sources -l   </p>
</blockquote>
<p>确保只有<code>https://gems.ruby-china.org/</code>一个源。<br><strong>这样就可以了？不一定</strong><br>可能由于网络问题，我这里失败了好几次后才成功。可以打开一个新的终端进入<code>~/.cocoapods/repos</code>目录使用命令<code>du sh *</code>命令查看，如果一直不变，基本上可以认为是失败了。</p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://vhuichen.github.io/2016/10/2016/10/iOS%E5%9F%BA%E7%A1%80%E4%B9%8BUIImage%E4%B8%A4%E7%A7%8D%E5%8A%A0%E8%BD%BD%E6%96%B9%E5%BC%8F%E7%9A%84%E5%8C%BA%E5%88%AB/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/vhuichen.jpg">
      <meta itemprop="name" content="vhuichen">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="vhuichen">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | vhuichen">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2016/10/2016/10/iOS%E5%9F%BA%E7%A1%80%E4%B9%8BUIImage%E4%B8%A4%E7%A7%8D%E5%8A%A0%E8%BD%BD%E6%96%B9%E5%BC%8F%E7%9A%84%E5%8C%BA%E5%88%AB/" class="post-title-link" itemprop="url">iOS基础之UIImage两种加载方式的区别</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2016-10-20 23:02:33" itemprop="dateCreated datePublished" datetime="2016-10-20T23:02:33+08:00">2016-10-20</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">Edited on</span>
      <time title="Modified: 2018-07-01 16:04:27" itemprop="dateModified" datetime="2018-07-01T16:04:27+08:00">2018-07-01</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/iOS%E5%9F%BA%E7%A1%80/" itemprop="url" rel="index"><span itemprop="name">iOS基础</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h2 id="序言"><a href="#序言" class="headerlink" title="序言"></a>序言</h2><p>比较两种使用方法的不同。</p>
<h3 id="imagedNamed"><a href="#imagedNamed" class="headerlink" title="imagedNamed"></a>imagedNamed</h3><p>使用此方法，系统会先从内存中查找此图片，如果找到，则返回显示。如果没有找到，则从指定的bundle中加载这张图片，然后缓存在系统内存中，并返回对象。			<br>优点：下次需要使用的时候，直接从缓存加载。			<br>缺点：增加了缓存需要的时间，图片越大，缓存需要的时间越长，并占用内存。</p>
<h3 id="imageWithContentsOfFile"><a href="#imageWithContentsOfFile" class="headerlink" title="imageWithContentsOfFile"></a>imageWithContentsOfFile</h3><p>此方法不会缓存图片，每次调用直接从指定的位置加载。<br>优点和缺点刚好和 imagedNamed 相反。</p>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>在不同的场景使用不同的方法。</p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://vhuichen.github.io/2016/10/2016/10/iOS%E5%9F%BA%E7%A1%80%E4%B9%8B%E6%90%AD%E5%BB%BASVN%E6%9C%8D%E5%8A%A1%E5%99%A8/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/vhuichen.jpg">
      <meta itemprop="name" content="vhuichen">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="vhuichen">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | vhuichen">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2016/10/2016/10/iOS%E5%9F%BA%E7%A1%80%E4%B9%8B%E6%90%AD%E5%BB%BASVN%E6%9C%8D%E5%8A%A1%E5%99%A8/" class="post-title-link" itemprop="url">iOS基础之搭建SVN服务器</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2016-10-18 00:15:53" itemprop="dateCreated datePublished" datetime="2016-10-18T00:15:53+08:00">2016-10-18</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">Edited on</span>
      <time title="Modified: 2020-05-03 00:38:37" itemprop="dateModified" datetime="2020-05-03T00:38:37+08:00">2020-05-03</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/iOS%E5%9F%BA%E7%A1%80/" itemprop="url" rel="index"><span itemprop="name">iOS基础</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>在Mac下写Demo，一般会把Demo放在GitHub上，但有些项目不允许公开，也不想每次写完一部分都手动本地保存，那么有一个较好的方法就是在搭建本地SVN服务器。</p>
<h1 id="搭建SVN服务器"><a href="#搭建SVN服务器" class="headerlink" title="搭建SVN服务器"></a>搭建SVN服务器</h1><p>Mac自带SVN服务，只需要手动开启即可使用。<br>步骤大致可分为两步，先创建一个创库，再启动SVN服务器<br><strong>注意：仓库目录是相对于服务器目录而言的，当我们连接一个SVN服务器的时候，仓库的目录是相对于服务器的</strong></p>
<h2 id="查看SVN版本"><a href="#查看SVN版本" class="headerlink" title="查看SVN版本"></a>查看SVN版本</h2><blockquote>
<p>chenhuideMBP:&#x2F; chenhui$ <strong>svnserve –version</strong><br>svnserve, version 1.9.4 (r1740329)<br>   compiled Aug 24 2016, 21:45:29 on x86_64-apple-darwin15.0.0</p>
</blockquote>
<blockquote>
<p>Copyright (C) 2016 The Apache Software Foundation.<br>This software consists of contributions made by many people;<br>see the NOTICE file for more information.<br>Subversion is open source software, see <a target="_blank" rel="noopener" href="http://subversion.apache.org/">http://subversion.apache.org/</a></p>
</blockquote>
<blockquote>
<p>The following repository back-end (FS) modules are available:</p>
<ul>
<li>fs_fs : Module for working with a plain file (FSFS) repository.</li>
<li>fs_x : Module for working with an experimental (FSX) repository.</li>
</ul>
</blockquote>
<h2 id="创建仓库"><a href="#创建仓库" class="headerlink" title="创建仓库"></a>创建仓库</h2><blockquote>
<p>svnadmin create &#x2F;SVN&#x2F;Local&#x2F;   </p>
</blockquote>
<p>一条语句简单粗暴搞定<br>其中<code>/SVN/Local/</code>为仓库的地址，如果没有权限则需要使用sudo<br>创建成功后，ls查看该目录会生成一下文件</p>
<blockquote>
<p>README.txt<br>db<br>hooks<br>conf<br>format<br>locks   </p>
</blockquote>
<h2 id="配置仓库"><a href="#配置仓库" class="headerlink" title="配置仓库"></a>配置仓库</h2><p>打开conf目录下的svnserve.conf文件，找到下面内容    </p>
<blockquote>
<p><code># anon-access = read</code><br><code># auth-access = write</code><br><code># password-db = passwd</code><br><code># authz-db = authz</code><br>去掉所有的#号，并把anon-access的值改为none，不允许匿名访问<br>anon-access &#x3D; <strong>none</strong><br>auth-access &#x3D; write<br>password-db &#x3D; passwd<br>authz-db &#x3D; authz   </p>
</blockquote>
<h2 id="配置登录账号和密码"><a href="#配置登录账号和密码" class="headerlink" title="配置登录账号和密码"></a>配置登录账号和密码</h2><p>打开conf目录下的passwd文件，并添加**<code>vhuichen = 123456</code>**</p>
<blockquote>
<p><code>[users]</code><br><code># harry = harryssecret</code>		<br><code># sally = sallyssecret</code>		<br><strong><code>vhuichen = 123456</code></strong><br>标示登录账号<code>vhuichen</code>和密码<code>123456</code>   </p>
</blockquote>
<h2 id="配置用户组和权限"><a href="#配置用户组和权限" class="headerlink" title="配置用户组和权限"></a>配置用户组和权限</h2><p>打开conf目录下的authz文件<br><img src="https://github.com/vhuichen/image/blob/master/image/svnauthz.png?raw=true" alt="Alt text"><br>设置组名，已经组用户。<br>[&#x2F;] 表示在根目录下 对应的组名拥有的权限   </p>
<h2 id="启动SVN服务器"><a href="#启动SVN服务器" class="headerlink" title="启动SVN服务器"></a>启动SVN服务器</h2><blockquote>
<p>svnserve -d -r &#x2F;SVN<br><code>注意：是/SVN而不是/SVN/Local</code><br><strong>一台Mac理论上只能启动一个SVN服务器，所以当远程需要连接的时候只要知道这台电脑的IP地址就可以知道这台电脑启动的SVN服务器的地址，而仓库的地址都是相对于这个服务器而言的，所以在填写仓库地址的时候只需要填写相对于服务器的地址就行了。</strong></p>
</blockquote>
<h1 id="配置Cornerstone"><a href="#配置Cornerstone" class="headerlink" title="配置Cornerstone"></a>配置Cornerstone</h1><blockquote>
<p>添加仓库</p>
</blockquote>
<h3 id="方法一："><a href="#方法一：" class="headerlink" title="方法一："></a>方法一：</h3><p><img src="https://github.com/vhuichen/image/blob/master/image/Cornerstone-FileRepository.png?raw=true" alt="Alt text">   </p>
<h3 id="方法二："><a href="#方法二：" class="headerlink" title="方法二："></a>方法二：</h3><p><img src="https://github.com/vhuichen/image/blob/master/image/SVNServeConnoct.png?raw=true" alt="Alt text"></p>
<p><strong>如果仓库在本地的话也可以使用<code>127.0.0.1</code>作为本机IP地址</strong></p>
<blockquote>
<p>添加成功后，右键添加项目<br><img src="https://github.com/vhuichen/image/blob/master/image/SVNAddFile.png?raw=true" alt="Alt text"><br><img src="https://github.com/vhuichen/image/blob/master/image/Cornerstone-AddFile.png?raw=true" alt="Alt text">   </p>
</blockquote>
<blockquote>
<p>指定需要上传的文件夹，点击Import后，添加需要上传的项目上传。</p>
</blockquote>
<h1 id="改进"><a href="#改进" class="headerlink" title="改进"></a>改进</h1><p>这里只创建了一个仓库，并且在一个仓库里管理多个项目。这样做好处是简单，但也会有一些问题，比如SVN只有一个版本号，修改任何一个项目都会增加版本号。<br>还有一种方法是为<strong>每一个项目创建一个独立的仓库</strong></p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://vhuichen.github.io/2016/10/2016/10/Markdown%E5%9F%BA%E7%A1%80%E8%AF%AD%E6%B3%95/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/vhuichen.jpg">
      <meta itemprop="name" content="vhuichen">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="vhuichen">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | vhuichen">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2016/10/2016/10/Markdown%E5%9F%BA%E7%A1%80%E8%AF%AD%E6%B3%95/" class="post-title-link" itemprop="url">Markdown基础语法</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2016-10-17 00:13:58" itemprop="dateCreated datePublished" datetime="2016-10-17T00:13:58+08:00">2016-10-17</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">Edited on</span>
      <time title="Modified: 2021-04-12 22:02:00" itemprop="dateModified" datetime="2021-04-12T22:02:00+08:00">2021-04-12</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Markdown/" itemprop="url" rel="index"><span itemprop="name">Markdown</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h3 id="插入代码块"><a href="#插入代码块" class="headerlink" title="插入代码块"></a>插入代码块</h3><pre><code>&gt;符号可以插入代码块
</code></pre>
<blockquote>
<p>&gt;这是代码块</p>
<blockquote>
<p>这是代码块</p>
</blockquote>
</blockquote>
<h3 id="插入图片"><a href="#插入图片" class="headerlink" title="插入图片"></a>插入图片</h3><blockquote>
<p>插入图片格式如下   </p>
</blockquote>
<pre><code>![Alt text](https://github.com/vhuichen/image/blob/master/image/text.png?raw=true)
</code></pre>
<blockquote>
<p><img src="https://github.com/vhuichen/image/blob/master/image/text.png?raw=true" alt="Alt text"></p>
</blockquote>
<h3 id="改变字体颜色"><a href="#改变字体颜色" class="headerlink" title="改变字体颜色"></a>改变字体颜色</h3><pre><code>&lt;font color = red&gt;字体颜色为红色&lt;/font&gt;
&lt;font color = blue&gt;字体颜色为蓝色&lt;/font&gt;
</code></pre>
<blockquote>
<p><font color="red">字体颜色为红色</font><br><font color="blue">字体颜色为蓝色</font></p>
</blockquote>
<h3 id="内容文字加粗、斜体"><a href="#内容文字加粗、斜体" class="headerlink" title="内容文字加粗、斜体"></a>内容文字加粗、斜体</h3><pre><code>Hi,I&#39;m **MarkDown加粗**
Hi,I&#39;m *MarkDown斜体*
</code></pre>
<blockquote>
<p>Hi,I’m <strong>MarkDown加粗</strong><br>Hi,I’m <em>MarkDown斜体</em><br>Hi,I’m <em><strong>MarkDown斜体加粗</strong></em>   </p>
</blockquote>
<h3 id="设置连接"><a href="#设置连接" class="headerlink" title="设置连接"></a>设置连接</h3><pre><code>这是我的[GitHub](https://github.com/vhuichen)链接
</code></pre>
<blockquote>
<p>这是我的<a target="_blank" rel="noopener" href="https://github.com/vhuichen">GitHub</a>链接</p>
</blockquote>
<h3 id="段首缩进"><a href="#段首缩进" class="headerlink" title="段首缩进"></a>段首缩进</h3><P style="TEXT-INDENT:2em">段首缩进测试，段首缩进测试，段首缩进测试，段首缩进测试，段首缩进测试，段首缩进测试，段首缩进测试，段首缩进测试</P>



      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://vhuichen.github.io/2016/10/2016/10/GitHub+Hexo+NexT%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2(%E8%BF%9B%E9%98%B6)/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/vhuichen.jpg">
      <meta itemprop="name" content="vhuichen">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="vhuichen">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | vhuichen">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2016/10/2016/10/GitHub+Hexo+NexT%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2(%E8%BF%9B%E9%98%B6)/" class="post-title-link" itemprop="url">GitHub+Hexo+NexT搭建个人博客(进阶)</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2016-10-15 21:34:51" itemprop="dateCreated datePublished" datetime="2016-10-15T21:34:51+08:00">2016-10-15</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">Edited on</span>
      <time title="Modified: 2018-04-08 22:57:57" itemprop="dateModified" datetime="2018-04-08T22:57:57+08:00">2018-04-08</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Hexo/" itemprop="url" rel="index"><span itemprop="name">Hexo</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="设置主题模式"><a href="#设置主题模式" class="headerlink" title="设置主题模式"></a>设置主题模式</h1><p>有三种主题模式可供选择</p>
<blockquote>
<p># Schemes<br>#scheme: Muse<br>#scheme: Mist<br>scheme: Pisces</p>
</blockquote>
<h1 id="创建分类、标签"><a href="#创建分类、标签" class="headerlink" title="创建分类、标签"></a>创建分类、标签</h1><p>进入NexT主题目录的<code>_config.yml</code>文件   </p>
<pre><code>1.去掉注释（一般也会去掉图标注释）
</code></pre>
<blockquote>
<p>menu:   	<br>  home: &#x2F;<br>  archives: &#x2F;archives<br>  categories: &#x2F;categories<br>  tags: &#x2F;tags<br>  about: &#x2F;about<br>  #search: &#x2F;search<br>  #commonweal: &#x2F;404.html   </p>
</blockquote>
<pre><code>2.创建页面
</code></pre>
<blockquote>
<p>hexo new page “tags”<br>hexo new page “categories”<br>hexo new page “about”   </p>
</blockquote>
<pre><code>3.修改新创建好的页面的内容
</code></pre>
<p>打开刚创建好的md文件，修改如下：<br><code>tags</code>文件</p>
<blockquote>
<p>-–<br>title: tags<br>date: 2016-10-23 23:16:24<br>type: “tags”<br>-–   </p>
</blockquote>
<p><code>categories </code>文件</p>
<blockquote>
<p>-–<br>title: categories<br>date: 2016-10-23 23:15:24<br>type: “categories”<br>-–   </p>
</blockquote>
<p><font color="red"><strong>type的值得标号必须为英文状态下的 “ “ 否则无法识别（弄了我好久。。。</strong>）</font>     </p>
<pre><code>4.在对应的文章标题处添加分类、标签
</code></pre>
<blockquote>
</blockquote>
<p>-–<br>title: Markdown基础语法<br>date: 2016-10-18 00:13:58<br>tags: [Markdown, Markdown1]<br>category: “Markdown”<br>-–</p>
<pre><code>5.
</code></pre>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://vhuichen.github.io/2016/10/2016/10/Github+Hexo+NexT%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2(%E5%9F%BA%E7%A1%80)/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/vhuichen.jpg">
      <meta itemprop="name" content="vhuichen">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="vhuichen">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | vhuichen">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2016/10/2016/10/Github+Hexo+NexT%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2(%E5%9F%BA%E7%A1%80)/" class="post-title-link" itemprop="url">GitHub+Hexo+NexT搭建个人博客(基础)</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2016-10-12 13:13:08" itemprop="dateCreated datePublished" datetime="2016-10-12T13:13:08+08:00">2016-10-12</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">Edited on</span>
      <time title="Modified: 2021-04-14 20:59:41" itemprop="dateModified" datetime="2021-04-14T20:59:41+08:00">2021-04-14</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Hexo/" itemprop="url" rel="index"><span itemprop="name">Hexo</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="序言"><a href="#序言" class="headerlink" title="序言"></a>序言</h1><p>一直想拥有一个自己的博客，记录自己学习内容以及生活经验。此前在群里看到一位大牛分享的自己的博客，马上就忍不住了，私信了那个大牛，询问建博客相关的问题，于是便开始了漫长的建站之路。<br>总体而言就是GitHub负责提供域名和服务器，Hexo负责建站，NexT负责主题。</p>
<h1 id="GitHub"><a href="#GitHub" class="headerlink" title="GitHub"></a>GitHub</h1><p>申请GitHub账号，作为域名和服务器。然后创建创库repository，仓库的名称为<code>yourmane.github.io</code><br>我的仓库名称是<code>vhuichen.github.io</code> 至于为什么要这样，我自己也不清楚。</p>
<h1 id="Hexo"><a href="#Hexo" class="headerlink" title="Hexo"></a>Hexo</h1><h2 id="介绍"><a href="#介绍" class="headerlink" title="介绍"></a>介绍</h2><p>Hexo是一个基于Node.js的静态博客，不需要学习任何网页技术，直接使用MarkDown写文章，生成静态网页并托管到GitHub上。官网 <code>https://hexo.io/zh-cn/</code> </p>
<h2 id="环境搭建"><a href="#环境搭建" class="headerlink" title="环境搭建"></a>环境搭建</h2><h3 id="安装Homebrew-（简称brew）"><a href="#安装Homebrew-（简称brew）" class="headerlink" title="安装Homebrew （简称brew）"></a>安装Homebrew （简称brew）</h3><p>看官网<code>http://brew.sh/index_zh-cn.html</code><br>安装只需要一条语句</p>
<blockquote>
<p><code>/usr/bin/ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;</code></p>
</blockquote>
<h3 id="安装node-js"><a href="#安装node-js" class="headerlink" title="安装node.js"></a>安装node.js</h3><p>官网<code>https://nodejs.org/en/</code>   </p>
<blockquote>
<p><code>brew install node</code></p>
</blockquote>
<h3 id="安装git"><a href="#安装git" class="headerlink" title="安装git"></a>安装git</h3><blockquote>
<p><code>sudo brew install git</code>   </p>
</blockquote>
<h3 id="安装Hexo"><a href="#安装Hexo" class="headerlink" title="安装Hexo"></a>安装Hexo</h3><blockquote>
<p><code>npm install -g hexo</code>   </p>
</blockquote>
<p>或者   </p>
<blockquote>
<p><code>npm install -g hexo-cli</code> </p>
</blockquote>
<h2 id="初始化配置"><a href="#初始化配置" class="headerlink" title="初始化配置"></a>初始化配置</h2><h3 id="在指定目录下初始化Hexo"><a href="#在指定目录下初始化Hexo" class="headerlink" title="在指定目录下初始化Hexo"></a>在指定目录下初始化Hexo</h3><p>在指定的目录下不需要加路径，如果不是则加上hexo初始化的路径</p>
<blockquote>
<p><code>hexo init</code><br><code>hexo init /blog</code></p>
</blockquote>
<h3 id="安装npm"><a href="#安装npm" class="headerlink" title="安装npm"></a>安装npm</h3><blockquote>
<p><code>npm install</code></p>
</blockquote>
<h3 id="在Hexo中部署git"><a href="#在Hexo中部署git" class="headerlink" title="在Hexo中部署git"></a>在Hexo中部署git</h3><blockquote>
<p>npm install hexo-deployer-git –save   </p>
</blockquote>
<p>没有这条语句会出现<code>ERROR Deployer not found: git</code>的错误</p>
<h1 id="使用NexT主题"><a href="#使用NexT主题" class="headerlink" title="使用NexT主题"></a>使用NexT主题</h1><h2 id="NexT官网"><a href="#NexT官网" class="headerlink" title="NexT官网"></a>NexT官网</h2><p><code>http://theme-next.iissnan.com/</code><br><font color="red"><strong>PS:看官方文档足够了</strong></font></p>
<h2 id="下载安装"><a href="#下载安装" class="headerlink" title="下载安装"></a>下载安装</h2><p>打开终端，定位到Hexo站点目录，将主题从git上下载<br>我的blog目录在<code>/blog/</code>下</p>
<blockquote>
<p><code>cd /blog/</code><br>git clone <a target="_blank" rel="noopener" href="https://github.com/iissnan/hexo-theme-next">https://github.com/iissnan/hexo-theme-next</a> themes&#x2F;next&#96;   </p>
</blockquote>
<p>#配置站点<code>_congif.yml</code><br>编辑Hexo目录下的<code>_config.yml</code>文件    </p>
<pre><code>1.配置NexT主题
</code></pre>
<blockquote>
<p># Extensions<br>## Plugins: <a target="_blank" rel="noopener" href="https://hexo.io/plugins/">https://hexo.io/plugins/</a><br>## Themes: <a target="_blank" rel="noopener" href="https://hexo.io/themes/">https://hexo.io/themes/</a><br><font color="red"><strong>theme: next</strong></font>   </p>
</blockquote>
<pre><code>2.配置仓库地址
</code></pre>
<blockquote>
<p># Deployment<br>## Docs: <a target="_blank" rel="noopener" href="https://hexo.io/docs/deployment.html">https://hexo.io/docs/deployment.html</a><br><strong>deploy:</strong><br>      <strong>type: git</strong><br>      <strong>repo: <a target="_blank" rel="noopener" href="https://github.com/vhuichen/vhuichen.github.io.git">https://github.com/vhuichen/vhuichen.github.io.git</a></strong><br>      <strong>branch: master</strong> </p>
</blockquote>
<p>##生成静态网页并启动本地服务<br>&#x2F;&#x2F;生成静态网页<br>&#x2F;&#x2F;启动本地服务</p>
<blockquote>
<p><code>hexo g</code><br><code>hexo s</code>	<br>在浏览器中输入<code>http://localhost:4000/</code> 即可查看网页</p>
</blockquote>
<h1 id="部署网页"><a href="#部署网页" class="headerlink" title="部署网页"></a>部署网页</h1><blockquote>
<p><strong>sudo hexo g</strong><br><strong>sudo hexo d</strong><br>在浏览器中输入地址<code>https://vhuichen.github.io/</code>即可查看网页</p>
</blockquote>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/page/9/"><i class="fa fa-angle-left" aria-label="Previous page"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/9/">9</a><span class="page-number current">10</span>
  </nav>

</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 2015 – 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">vhuichen</span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener" target="_blank">NexT.Pisces</a>
  </div>

    </div>
  </footer>

  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  





  





</body>
</html>
